

use std::fmt::Debug;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
    #[error("配置文件中流程id:{id},名称{name},版本{version}有误:{msg}")]
    Conf { id: u32, name: String,version:u8, msg: String },
    #[error(transparent)]
    Other(#[from] anyhow::Error),
}
impl Error {
    pub fn from_conf(id: u32, name: impl AsRef<str>,version:u8, msg: impl AsRef<str>) -> Self {
        Error::Conf {
            id,
            name: name.as_ref().to_owned(),
            version,
            msg: msg.as_ref().to_owned(),
        }
    }
}
